Skip to content

Sidebar sorting does not account for short-title in front matter #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dipikabh opened this issue Apr 25, 2025 · 0 comments
Open

Sidebar sorting does not account for short-title in front matter #201

dipikabh opened this issue Apr 25, 2025 · 0 comments
Labels
needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@dipikabh
Copy link
Contributor

What information was incorrect, unhelpful, or incomplete?

When using type: listSubPages in the sidebar YAML, items in the sidebar are sorted in the alphabetical order of their titles. This is the default behavior.

However, this sorting does not consider short-title for sorting even though short-title is what's actually displayed in the sidebar. The sorting still uses title even if short-title is present.

Check out this demo commit that uses type: listSubPages: dipikabh/content@dea9711. This produces the following sorting in the sidebar:

sidebar-bug-sorting-short-title

For context, these pages have the following titles and short-titles in their front matters:

title short-title slug
HTML cheatsheet for syntax and common tasks HTML cheatsheet Web/HTML/Guides/Cheatsheet
Using HTML comments Comments Web/HTML/Guides/Comments
Using HTML form validation and the Constraint Validation API Constraint validation Web/HTML/Guides/Constraint_validation
Content categories - Web/HTML/Guides/Content_categories
Using date and time formats in HTML Date and time formats Web/HTML/Guides/Date_and_time_formats
Using microdata in HTML Microdata Web/HTML/Guides/Microdata
Using microformats in HTML Microformats Web/HTML/Guides/Microformats
Understanding quirks and standards modes Quirks and standards modes Web/HTML/Guides/Quirks_mode_and_standards_mode
Using responsive images in HTML Responsive images Web/HTML/Guides/Responsive_images
Using the viewport meta element Viewport meta element Web/HTML/Guides/Viewport_meta_element

What did you expect to see?

  • Expected to see the following ordering in the sidebar when using listSubPages:
Comments
Constraint validation
Content categories
Date and time formats
HTML cheatsheet
Microdata
Microformats
Quirks and standards modes
Responsive images
Viewport meta element
  • If a page defines a short-title, that should be used for sorting along with other pages that have only title defined, so that alphabetical ordering happens regardless of which field is present in the front matter.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

The problem I'm reporting here is not on the site, I observed this when I earlier used type: listSubPages.

The list under "Guides" section in the HTML sidebar has now been manually ordered (in this PR) to list more familiar tasks first and niche or advanced topics later.

@dipikabh dipikabh added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

No branches or pull requests

1 participant